#include "comm.hpp"

int main()
{
    Init init(SERVER);
    char* start = init.getStart();
    int n = 0;
    while (n <= 30)
    {
        cout << "client->server# " << start << endl;
        sleep(1);
        ++n;
    }    

    // key_t k = getKey();
    // cout << "server: " << toHex(k) << endl;
    // int shmid = createShm(k, gsize);
    // cout << "server shmid: " << toHex(shmid) << endl;

    // sleep(5);

    // struct shmid_ds ds;
    // int n = shmctl(shmid, IPC_STAT, &ds);
    // if (n != -1)
    // {
    //     cout << "perm: " << ds.shm_perm.__key << endl;
    //     cout << "creater pid: " << ds.shm_cpid << " : " << getpid() << endl;
    // }

    // char* start = attachShm(shmid);

    // sleep(5);

    // detachShm(start);

    // delShm(shmid);
    return 0;
}